<template>
  <div class="layout">
    <el-container class="el-container">
      <el-aside width="200px">
        <!-- 侧边栏组件 -->
        <v-side></v-side>
      </el-aside>
      <el-container>
        <el-header>
          <!-- 头部组件 -->
          <el-button @click="logout">退出登录</el-button>
        </el-header>
        <el-main>
          <router-view class="router-view"></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import vSide from '../components/side'
export default {
  components: {
    vSide
  },
  methods: {
    logout() {
      this.$router.push('/login')
    }
  }
};
</script>

<style>
.layout .router-view{
  text-align: left;
}
.layout .el-container {
  height: 100vh;
}
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 80px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>